let app = getApp()
var stylecss = require('../../utils/stylecss.js');
Component({ 
    properties: {
         pagetitle:String
      },
      data:{
      
      },
    lifetimes: {
        attached: function () {
          var that=this
          wx.request({
            url: app.globalData.siteroot,
            data: {
              m:'yb_shopv2_video',
              do:'Site_getSiteAbout'
            },
            success: function(res) {
              wx.setNavigationBarTitle({
                title:res.data.info.name
             })
             that.setData({
              detail:res.data.info
             })
            }
          })
       }
      },
    methods: {
      jumpmap:function(){
        var t = this, e = {
          type: "map",
          type_name:this.data.detail.name,
          id: "",
          url: JSON.parse(this.data.detail.postion),
          title:this.data.detail.name
        };
        stylecss.jumpurl(e);
      },
      makePhoneCall:function(){
        wx.makePhoneCall({
          phoneNumber: this.data.detail.phone,
          success:function(){
            console.log('拨打成功')
          },
          fail:function(){
            console.log('拨打失败')
          }
        })
      },
    }
});
